<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->
<script id="cluster-summary-template" type="text/html">
<table id="cluster-summary-table" class="table compact">
  <thead>
    <tr>
      <th>
        <span data-toggle="tooltip" data-placement="right" title="The version of storm installed on the UI node. (Hopefully, this is the same on all storm nodes!)">
          Version
        </span>
      </th>
      <th>
        <span data-toggle="tooltip" data-placement="right" title="The duration the current Nimbus instance has been running. (Note that the storm cluster may have been deployed and available for a much longer period than the current Nimbus process has been running.)">
          Nimbus uptime
        </span>
      </th>
      <th>
        <span data-toggle="tooltip" data-placement="above" title="The number of nodes in the cluster currently.">
          Supervisors
      </span>
      </th>
      <th>
        <span data-toggle="tooltip" data-placement="above" title="Slots are Workers (processes).">
          Used slots
      </span>
      </th>
      <th>
        <span data-toggle="tooltip" data-placement="above" title="Slots are Workers (processes).">
          Free slots
      </span>
      </th>
      <th>
        <span data-toggle="tooltip" data-placement="above" title="Slots are Workers (processes).">
          Total slots
      </span>
      </th>
      <th>
        <span data-toggle="tooltip" data-placement="above" title="Executors are threads in a Worker process.">
          Executors
      </span>
      </th>
      <th>
        <span data-toggle="tooltip" data-placement="left" title="A Task is an instance of a Bolt or Spout. The number of Tasks is almost always equal to the number of Executors.">
          Tasks
        </span>
      </th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{stormVersion}}</td>
      <td>{{nimbusUptime}}</td>
      <td>{{supervisors}}</td>
      <td>{{slotsUsed}}</td>
      <td>{{slotsFree}}</td>
      <td>{{slotsTotal}}</td>
      <td>{{executorsTotal}}</td>
      <td>{{tasksTotal}}</td>
    </tr>
  </tbody>
</table>
</script>
<script id="topology-summary-template" type="text/html">
  <table class="table table-striped compact" id="topology-summary-table">
    <thead>
      <tr>
        <th>
          <span data-toggle="tooltip" data-placement="right" title="The name given to the topology by when it was submitted. Click the name to view the Topology's information.">
            Name
          </span>
        </th>
        <th>
          <span data-toggle="tooltip" data-placement="right" title="The unique ID given to a Topology each time it is launched.">
            Id
          </span>
        </th>
        <th>
          <span data-toggle="tooltip" data-placement="above" title="The user that submitted the Topology, if authentication is enabled.">
            Owner
          </span>
        </th>
        <th>
          <span data-toggle="tooltip" data-placement="above" title="The status can be one of ACTIVE, INACTIVE, KILLED, or REBALANCING.">
            Status
          </span>
        </th>
        <th>
          <span data-toggle="tooltip" data-placement="above" title="The time since the Topology was submitted.">
            Uptime
          </span>
        </th>
        <th>
          <span data-toggle="tooltip" data-placement="above" title="The number of Workers (processes).">
            Num workers
          </span>
        </th>
        <th>
          <span data-toggle="tooltip" data-placement="above" title="Executors are threads in a Worker process.">
            Num executors
          </span>
        </th>
        <th>
          <span data-toggle="tooltip" data-placement="above" title="A Task is an instance of a Bolt or Spout. The number of Tasks is almost always equal to the number of Executors.">
            Num tasks
          </span>
        </th>
        <th>
          <span data-toggle="tooltip" data-placement="left" title="This shows information from the scheduler about the latest attempt to schedule the Topology on the cluster.">
            Scheduler Info
          </span>
        </th>
      </tr>
    </thead>
    <tbody>
      {{#topologies}}
      <tr>
        <td><a href="/topology.html?id={{encodedId}}">{{name}}</a></td>
        <td>{{id}}</td>
        <td>{{owner}}</td>
        <td>{{status}}</td>
        <td>{{uptime}}</td>
        <td>{{workersTotal}}</td>
        <td>{{executorsTotal}}</td>
        <td>{{tasksTotal}}</td>
        <td>{{schedulerInfo}}</td>
      </tr>
      {{/topologies}}
    </tbody>
  </table>
</script>
<script id="supervisor-summary-template" type="text/html">
<table class="table table-striped compact" id="supervisor-summary-table">
  <thead>
    <tr>
      <th>
        <span data-toggle="tooltip" data-placement="right" title="A unique identifier given to a Supervisor when it joins the cluster.">
          Id
        </span>
      </th>
      <th>
        <span data-toggle="tooltip" data-placement="above" title="The hostname reported by the remote host. (Note that this hostname is not the result of a reverse lookup at the Nimbus node.)">
          Host
        </span>
      </th>
      <th>
        <span data-toggle="tooltip" data-placement="above" title="The length of time a Supervisor has been registered to the cluster.">
          Uptime
        </span>
      </th>
      <th>
        <span data-toggle="tooltip" data-placement="above" title="Slots are Workers (processes).">
          Slots
        </span>
      </th>
      <th>
        <span data-toggle="tooltip" data-placement="left" title="Slots are Workers (processes).">
          Used slots
        </span>
      </th>
      <th>
        <span data-toggle="tooltip" data-placement="left" title="Version">
          Version
        </span>
      </th>
    </tr>
  </thead>
  <tbody>
    {{#supervisors}}
    <tr>
      <td>{{id}}</td>
      <td>{{host}}</td>
      <td>{{uptime}}</td>
      <td>{{slotsTotal}}</td>
      <td>{{slotsUsed}}</td>
      <td>{{version}}</td>
    </tr>
    {{/supervisors}}
  </tbody>
</table>
</script>

<script id="configuration-template" type="text/html">
  <table class="table table-striped compact" id="nimbus-configuration-table">
    <thead>
      <tr>
        <th>Key</th>
        <th>Value</th>
    </tr>
    </thead>
    <tbody>
      {{#config}}
      <tr>
        <td>{{key}}</td>
        <td>{{value}}</td>
      </tr>
      {{/config}}
    </tbody>
  </table>
</script>
